home *** CD-ROM | disk | FTP | other *** search
- Public Class OtherControlsForm
- Inherits System.Web.UI.Page
- Protected WithEvents Calendar1 As System.Web.UI.WebControls.Calendar
- Protected WithEvents Xml1 As System.Web.UI.WebControls.Xml
- Protected WithEvents Label1 As System.Web.UI.WebControls.Label
- Protected WithEvents AdRotator1 As System.Web.UI.WebControls.AdRotator
-
- #Region " Web Form Designer Generated Code "
-
- 'This call is required by the Web Form Designer.
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
-
- End Sub
-
- Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
- 'CODEGEN: This method call is required by the Web Form Designer
- 'Do not modify it using the code editor.
- InitializeComponent()
- End Sub
-
- #End Region
-
- ' this event fires when the Calendar is rendering each of its cells
-
- Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender
- ' Ensures that days 12/24 to 12/26 are displayed with yellow background.
- If Not e.Day.IsOtherMonth Then
- ' Consider only days in the current month.
- If e.Day.Date.Month = 12 AndAlso e.Day.Date.Day >= 24 And e.Day.Date.Day <= 26 Then
- e.Cell.BackColor = Color.Yellow
- ' Prevent the user from selecting these days.
- e.Day.IsSelectable = False
- End If
- End If
-
- If e.Day.Date.Day = 1 Then
- Dim imgCtrl As New System.Web.UI.WebControls.Image()
- imgCtrl.ImageUrl = "file:///E:\Inetpub\wwwroot\warning.gif"
- imgCtrl.Width = Unit.Percentage(100)
- imgCtrl.Height = Unit.Percentage(100)
- e.Cell.Text = ""
- e.Cell.Controls.Add(imgCtrl)
- End If
- End Sub
-
- ' this event fires when the user selects a new date
- Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
- Label1.Text = "Current Selected Date " & Calendar1.SelectedDate.ToLongDateString
- End Sub
-
- End Class
-